package com.ruoyi.system.api;

import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.api.domain.*;
import com.ruoyi.system.api.factory.RemoteManagerFallbackFactory;
import com.ruoyi.system.api.factory.RemoteUserFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 类名：
 * 作者：WF
 * 功能：
 */
@FeignClient( value = ServiceNameConstants.MANAGER_SERVICE, fallbackFactory = RemoteManagerFallbackFactory.class)
public interface RemoteManagerService {

	//1. 根据广告分类id查询广告列表
	@GetMapping("/content/findById/{id}")
	R<List<Content>> findById(@PathVariable("id") Long id);
	//2. 根据广告id查询广告
	@GetMapping("/content/findContentById/{id}")
	R<Content> findContentById(@PathVariable("id") Long id);
	//3. 添加广告
	@PostMapping("/content/add")
	R insert(@RequestBody Content content);

	@GetMapping("/item/list")
	R<List<Item>> findItems();

	//根据商品id查询spu商品对象
	@GetMapping("/goods/findById/{id}")
	R<Goods> findGoodsById(@PathVariable("id") Long id);

	@GetMapping(value = "/desc/findById/{goodsId}")
	R<GoodsDesc> findDescById(@PathVariable("goodsId") Long goodsId);

	@GetMapping("/cat/findNameById/{id}")
	 R<String> findNameById(@PathVariable("id") Long id);

	@GetMapping("/item/findItemsByGoodsId/{goodsId}")
	R<List<Item>> findItemsByGoodsId(@PathVariable("goodsId") Long id);

	@GetMapping("/brand/findAll")
	R<List<Brand>> findAllBrands();

	@GetMapping("/item/findItemById/{id}")
	R<Item> findItemById(@PathVariable("id") Long id);

	@PostMapping("/brand/save")
	R addBrand();
}
